const activeName = ref<number>(0);
const tabList = ref<any[]>([]);
const duration = 300;
import i18n from "@/locales/i18n";
const { t } = i18n.global;
export default function useVueTabs(isFetching = true): any {
  async function fetchTabList() {
    const timer = setTimeout(() => {
      clearTimeout(timer);
      tabList.value = [
        { title: t("title01"), name: 0 },
        { title: t("title02"), name: 1 },
        { title: t("title03"), name: 2 }
      ];
    }, 300);
  }
  onMounted(() => {
    isFetching && !tabList.value.length && fetchTabList();
  });
  return { fetchTabList, activeName, tabList, duration };
}
